<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="main.css" type="text/css" ></link>
    </head>
  <body>
      <div id="main-frame">
          <div id="control">
          <div id="switch">
              <button value="switch" onclick="toggleall()" display="none" >switch</button>
              </div>
          </div>
    <textarea id="text-input" onpropertychange= "this.style.posHeight=this.scrollHeight " 
              rows="6" cols="60">#自强奋斗
- - -
本站关注计算机科学中的软硬件技术，站点重建中，敬请期待。。。</textarea>
    <div id="preview"> </div>
      </div>
      <div id="beian"> <a href="http://www.miitbeian.gov.cn/" style="color:#aaa;text-decoration:none;">辽ICP备08006882号-3</a></div>
    <script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/markdown.js/0.5.0/markdown.min.js"></script>
    <script>
                 
      function Editor(input, preview) {
        this.update = function () {
          preview.innerHTML = markdown.toHTML(input.value);
        };
        input.editor = this;
        this.update();
      }
      var $ = function (id) { return document.getElementById(id); };
      new Editor($("text-input"), $("preview"));
      $("text-input").oninput = this.editor.update;
      document.getElementById("preview").style.display="block";
      document.getElementById("text-input").style.display="none";
        
      function toggleall() {
        toggle("preview");
        toggle("text-input");
      }
      function toggle(targetid){
        if (document.getElementById){
            target=document.getElementById(targetid);
            if (target.style.display!="none"){
                target.style.display="none";
            } else {
                target.style.display="block";
            }
        }
      }         
    </script>
  </body>
</html>

